//
//  DDAbout.m
//  dingdang
//
//  Created by lichq on 7/24/15.
//  Copyright (c) 2015 阮 沧晖. All rights reserved.
//

#import "DDAbout.h"
#import "DDNetWorkAPIClient.h"
#import "UICommonFunc.h"

@interface DDAbout ()
@property (weak, nonatomic) IBOutlet UILabel *labVersion;

@property (weak, nonatomic) IBOutlet UIImageView *logo;
@end

@implementation DDAbout

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    [self createUI];
    
    NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary];
    CFShow((__bridge CFTypeRef)(infoDictionary));
    NSString *app_Version = [infoDictionary objectForKey:@"CFBundleShortVersionString"];
    //NSString *app_build = [infoDictionary objectForKey:@"CFBundleVersion"];
    
    self.labVersion.text =  [NSString stringWithFormat:@"V%@", app_Version];
    
    DDNetWorkAPIClient *network = [[DDNetWorkAPIClient alloc] init];
    
    [network getAbout:^(BOOL isSuccess, NSString *message, NSString *status, id object) {
        NSLog(@"%@", message);
    }];

}

- (void)createUI
{
    self.view.backgroundColor = RGB(245, 245, 245);
    self.automaticallyAdjustsScrollViewInsets = NO;
    self.navigationController.navigationBarHidden = YES;
    //自定义TAB BAR UI
    [self addNavigatorTitle:NSLocalizedString(@"关于", nil) parent:self.view];
    self.barViewControl.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"top_Background"]];
    [self AddLeftBtnAction:nil normal:@"top_返回" selected:@"top_返回" action:^{
        //[self dismissViewControllerAnimated:YES completion:nil];
        [self.navigationController popViewControllerAnimated:YES];
    }];
    
    self.logo.layer.cornerRadius = 10.0;
    self.logo.layer.masksToBounds = YES;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
